# Maintainer: David Runge <dave@sleepmap.de>
# Contributor: Ray Rashif <schiv@archlinux.org>
# Contributor: Rob Til Freedmen <rob.til.freedman@gmail.com>
# Contributor: Damir Perisa <damir.perisa@bluewin.ch>
# Contributor: Robert Emil Berge

pkgname=swh-plugins
pkgver=0.4.17
pkgrel=4
pkgdesc="Steve Harris' LADSPA plug-ins suite"
arch=('loong64' 'x86_64')
url="http://plugin.org.uk/"
license=('GPL2')
depends=('fftw' 'gsm')
makedepends=('ladspa' 'libxml2' 'perl-xml-parser')
groups=('ladspa-plugins' 'pro-audio')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/swh/ladspa/archive/v${pkgver}.tar.gz"
        'use_system_gsm.patch')
sha512sums=('6b566030b43c3929ce8938648abd458efa0fea0b4916410a34b4f4fa788c45e4a6ec3f46ca435f8546179ff0c4674303db22314e1c1f1d09e5f2b71e6c5aecc7'
            '7080a115442d682bdad17b2bfa2694ba5f6ef53efcd214748fe26133dda6a79726f57e34819e2324d1bf0a999baf5c895cba488658cc9695d4903755dce5774f')

prepare() {
  mv -v ladspa-${pkgver} "${pkgname}-${pkgver}"
  cd "${pkgname}-${pkgver}"
  # patching to use system gsm library
  patch -Np1 -i "${srcdir}/use_system_gsm.patch"
  autoreconf -vfi
  export CFLAGS="$CFLAGS -fPIC"
}

build() {
  cd "${pkgname}-${pkgver}"
  ./configure --prefix=/usr
  make
}

package() {
  cd "${pkgname}-${pkgver}"
  make DESTDIR="$pkgdir/" install
  install -t "${pkgdir}/usr/share/doc/${pkgname}" \
    -vDm 644 {AUTHORS,ChangeLog,NEWS,README,TODO}
}

# vim:set ts=2 sw=2 et:
